<template>
    <div style="margin-top:50px;">
        <van-slider v-model="value" @change="changeVal"/>
    </div>
</template>

<script>
import { mapGetters, mapMutations} from 'vuex';
export default {
    data(){
        return{
            value:0
        }
    },
    computed:{
        ...mapGetters(['getSongCurTime','getSongTime'])
    },
    watch:{
        getSongCurTime(){
            this.value = parseInt((this.getSongCurTime/this.getSongTime)*100);
            //console.log(this.value)
        }
    },methods:{
        ...mapMutations(['setSsongCurTime']),
        changeVal(){
            console.log(this.value)
            this.setSsongCurTime((this.value/100)*this.getSongTime);
        }
    }
}
</script>